package com.easy.stock.dao;

import com.easy.stock.domain.StockEarning;

public class StockEarningDao extends BaseDao {
	
	public void addEarning(StockEarning earning) {
		
		String query = "{stock_id:\"" + earning.getStock_id() 
				+ "\",quarter:\"" + earning.getQuarter()
				+ "\"},"
				+ "{consensus_estimate:\"" + earning.getConsensus_estimate()
				+ "\",actual_eps:\"" + earning.getActual_eps()
				+ "\",revenue_estimate:\"" + earning.getRevenue_estimate()
				+ "\",actual_revenue:\""+earning.getActual_revenue()
				+ "\",time:#}";
		
		getCollection().update(query, earning.getTime()).upsert().with(earning);
	}
}
